Add MacOS autodetection to Makefiles