added -lm flag and defined _bsd_source