Add the missing -lm flag for linking