This little package helps creating Makefile files programmatically. Install from GitHub:
Makefile
devtools::install("krlmlr/MakefileR")
See the vignette for more detail.