You need to link against the math library, libm. Add -lm to the compiler command line.