Does it work on the Atmega1284 (non-P) as well ?
It should. Like the 328 vs 328p, the differences are pretty subtle. However, I don't have and haven't tested a 1284(non-P)...
I just had to read through the makefile a little bit, add in some lines for a 12MHz version
If all you are doing is changing the clockrate, you should have been able to do it all from the command line like:
make atmega1284 AVR_FREQ=12000000