Restore Mac support with some Makefile magic