tests, examples: fix LDFLAGS vs LDADD use

Extra libraries to link belong in LDADD, not LDFLAGS.

This fixes the build under jhbuild on FreeBSD.

https://bugzilla.gnome.org/show_bug.cgi?id=724189
fix automake warnings