Added -lm to link with math libraries