make: do a better job of sanitizing LD_LIBRARY_PATH (fixes #8069)