Fixed up the Makefile some; also added some debugging checks.