fix dimension error and add makefile