Makefile fixes for configure build