added -lm flag to Makefile