How to compile OSS binaries to replace the versions shipped with OS X?
You will need to individually check and build every program, although the process for most programs is fairly similar.

You might be able to take some inspiration from MacPorts/Homebrew in their recipes, but I doubt that you can use them 1:1 as they typically feature versions that differ greatly from the Apple supplied utilities. For example by offering GNU versions of supplied BSD utilities, or by offering something that is a completely different major version.

As an example of this, I saw that you received a comment on your question recommending you to install "openssl" for example. This can be quite tricky, as if you install "openssl", you actually get something substantially different than what Apple actually supplies with macOS today. If you run the command "openssl" on a modern Mac, you'll actually be running something called LibreSSL. You'll have to make an individual choice for each and every software package such as this to determine if you want to go with Apple's choice (LibreSSL), or a new major version of OpenSSL. 

I think the most feasible route is to go to Apple's open source web site:

https://opensource.apple.com

Here'll you find the source for the utilities that came with your 10.9 system. Using that list, I would go through the sources for 10.15 and find the same programs.

This will often give you security patched versions of the same major version or at least very similar programs to the ones that came with your 10.9 system. If you're lucky, they compile without problems. In some cases, you'll run into stuff that is only supported on newer operating systems, and then you'll have to work around it by modifying the program, or going back to an older version.

All in all, it is going to be a lot of work!