more work on Makefile and agent