The State of Michigan has agreed to spend $87 million in a proposed settlement to replace thousands of lead pipes throughout Flint over the next three years, the latest effort by state and city officials to fix the contaminated water system.