Fix misuse of -lm flag when building C programs needing the math library.