Fix search in ld script, fix error match for FreeBSD