Added OS detection and variable setting in Makefile.