Added -lm to compile statement so that it builds on Ubuntu 13.