Fixes for building GHC Head and GHCJS Gen2