Modified makefile to make it more robust.