improve Makefile handling of git checkouts with missing lib/ and config.mak