A nights sleep did it.
I had been running the GNU toolchain in my home directory - a cd to /home/alan/Desktop/template (I had got rid of /pimach by then for simplicity) and then "make" worked.
Now to try it on the pi.
I am trying with a new sd card with just loader.bin, bootcode.bin, start.elf, config.txt, and my new kernel.img.
I may have to adjust config.txt as others have suggested but we shall see.