The problem is that not having the library usually means you also don’t have the headers, so you can’t compile the C code that would use it. What you’re talking about isn’t impossible, but it probably requires either a binary distribution built from a system aware of these libraries (this is the Darwin+availability attributes approach) or some massive header repository that you can pull from to build things.