cleaned up makefile and added matrix headers