Import r44526 from ruby trunk

BASERUBY is not set usually.  fix errors in mkmf tests.

Duplicate of ruby/ruby@fe46b2d