Compiling 1.3.1 fails with undefined LLVM error

About 2 months ago I compiled Julia1.3.1 from source, there was no problem.
Now, Julia1.4.0 compiles from source, however checking out the 1.3.1 and compiling (same steps as before) gives an error about

undefined reference to llvm::sys::getProcessTriple()

What causes the same code and same instructions to work, and then fail later?

It would be great if you could provide steps that reproduce this from scratch (eg a script, starting with checking out the relevant branch).

Swapping between julia versions that uses different LLVMs doesn’t work perfectly i think. You might need to make - C deps distcleanall before building.