Add -lm in dynamic linking