Fix library loading on FreeBSD systems

Libc does not load on FreeBSD. This updates the regex to detect ld scripts on FreeBSD properly.