Added lib math to `Makefile`, renamed M_PI to PI and added missing `#define` in `envtoirr.c`

I made a mess of my `git` history, so I decided to make a new commit with only the useful bits; here's the update [as requested](1#issuecomment-31658096).