E-cigarette maker Juul agreed Monday to pay North Carolina $40 million and adjust its sales and marketing strategies to settle a lawsuit filed by the state.