checkpoint target rule / variable cleanup

Clean up target rule variable declaration for generic override
First pass of Makefile generator
Centralize lua code