configure: change LIBS not LDFLAGS when checking for libs

Closes #289

Patch-by: maurerpe