Makefile changes and bug detection updated