Makefile improvements and gray.cc
add gray.cc