Looking at it again, it turns out it did need some relatively minor changes to build. I'm trying to remember exactly but I think I had to add -fcommon for later gcc versions and I also had to update config.sub and config.guess. I'll check it again and then I might just put my working compile on Github again when I'm back from visiting family.