added missing -lm flag