Modified Makefile for compiling gfortran and fixed some bug