fix compilation on gentoo releases

attempt to fix compilation on both osx and gentoo according to advices on rubys/nokogumbo#4