added friend declaration example and generalized the Makefile