test_libs.rb: new test

* test/mkmf/test_libs.rb (TestMkmf:TestLibs): tests for $libs operations.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
mkmf.rb: fix merge_libs

* lib/mkmf.rb (MakeMakefile#merge_libs): insert following reversal
  ordered elements just after the duplicated element, not overwriting
  successive elements.  [ruby-core:50314] [Bug #7467]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e