Fix makefiles for building on Mavericks