Flextronics International has agreed to clean up the groundwater that contaminated the wells at 21 homes along Stony Hill Road near Wake Forest.