moved -lm flag