Move -lm to the end, thanks Michael Gozhev