Changed to a do-while (from while) in main.c, added OS X support for Makefile

Instead of essentially doing a do-while loop separately (setting
variables and THEN doing a while loop) for setting the h value, now
this is a do-while loop, which reduces only 4 lines of code.

Also, tested the Makefile on OS X and made fixes to ensure it works
there.