added -lm flag for linking math.c in unixy systems