Use library detection instead of hardcoding library paths, for cross-platform compatibility.