The file template=makefile with content
NAME=main
FILES=%HERE%
DEP=$(NAME).pandoc $(FILES)
# vim:ft=make
produces, when calling vim makefile, the following file:
NAME=main
FILES=%HERE%
DEP=$(NAME).pandoc $(FILES)
That is, the comment disappears. In fact, if the comment is not placed at the beginning of the file, all lines below it won't appear when the template is expanded.