Added another check to fix ordering problem in Makefile