Added -lm for linking against math library