Only regenerate it if the configuration has changed. Also, do this after
the modules build to fix errors with some weird Makefiles that are
generated during build.
Reported-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>