fixed some problems that stopped compilation; changed library flag to -lm