Add some error checking to Makefile