Split LDFLAGS and LDLIBS to handle ubuntu linker failure

The default/implicit linking rule places LDFLAGS before the object. This causes
the build to break on some systems with undefined symbol errors. Placing the
libraries in LDLIBS pushes them after the .o file, and fixes the error.
Add missing dependencies
Merge pull request #1 from vhallac/pull-req

Multiple fixes for ubuntu precise with pbuilder build