patchupdate.py: Improve generated Makefile and delete *.ok files on error.