workaround for bug in mkmf

works-around a known bug in mkmf, which was resolved in
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/39717

Since the current Windows Ruby distribution doesn't include this fix yet,
we work around it by detecting whether mkmf is functioning properly or
not, and fixing it if it's not. This behavior will degrade gracefully if
the user is running a version of mkmf with the fix.
Merge pull request #393 from monban/mkmf-workaround

workaround for bug in mkmf