They were horrendous, and now are unnecessary, but we have CMake and it is getting to be a problem of its own. Things now mostly just need to build on linux, windos, and macosix, and everything is little-endian.
I did write code portable to all of the workstation platforms (and VAXstations running VMS), and my approach was not to use separate scripts, but to write in a particular slightly-subset of K&R C (with portability macros to reintroduce some features), deal with compiler/architecture/library differences, and go through the docs and `cpp` output looking for preprocessor symbols that could help distinguish a particular platform (and you couldn't even use `#if`; it had to be `#ifdef`). For some purposes, cpp alone wouldn't be enough, and employer, which ran on all the workstations, had to develop its own portable graphics and GUI layers, IPC abstractions, etc. Makefiles were still heck for varying behavior between platforms, and you couldn't even use all the GNU Make features (though, in hindsight, maybe we should've, even when we had to keep using the vendor compiler toolchain), so complicated projects wouldn't necessarily be able to use a single Makefile alone.
It was also a huge PITA to get any 3rd party Unix software to compile on Domain/OS. I went to a college that had exclusively Apollo workstations and you had to get really creative with Makefiles, #ifdef, #include, and writing compatibility layers to make it play in the SunOS/Solaris/SCO world of the time.
Eventually we started getting "HP Apollo" HPUX systems, which weren't that great either, but at least they were closer to mainstream Unix.