Different versions and distros of operating systems likely linked against different versions of Berkeley DataBase too so maybe it would have needed each old version of bitcoin, with each compatible version of the BDB linked to each one
This is why I try to build only stand-alone repositories for my applications. I don't link to external libraries and I don't use submodules. Any external libraries that I use I bring in using git-subtree which makes a complete copy of the sources and inserts it into my repository. This way there is no possible way that anything can be screwed up in the manner you described. What gets built is the same for all machines.
The usual objection from GNU/Linux diehards is that I am duplicating the storage for a lot of libraries and I'm creating a large executable by avoiding shared libraries (or DLLs on Windows) but in practice it is more convenient and less risky.
You'll note that every single repository linked in my signature can be built flawlessly from a single "git clone", without having to obtain any other source trees, even though I frequently make use of multiple open source libraries (Lua, FreeType, JUCE, SQLite, TagLib to name a few).
Reference Bitcoin client source code repository should git-subtree the entire source tree of Berkeley DB (and all of its dependencies), and statically link the BDB implementation directly into the executable.