[bootstrap] change mkmf.rb to generate stable Makefiles (from Richard Braakman)

The Makefiles need to be identical from build to build in order to
prevent unneeded rebuilds in OBS. In particular, the ordering of
object files on the linker command line has to be stable to get
reproducible builds.