move -lm a the end of flag