makefile: more error checking