kbuild: fix a bug in regeneration of linker scripts