Replace _LDFLAGS with _LIBADD where needed
Merge pull request #1756 from rubenk/ldflags-to-libadd

Replace _LDFLAGS with _LIBADD where needed