allow overriding specific arguments without changing the Makefile

for example, now you can do:

 make PREFIX=/usr

without any modification to the Makefile and have it behave as
intended.
Fix link order for --as-needed (see http://bugs.debian.org/711958)

In Ubuntu, the attached patch was applied to achieve the following:

  * as-needed.patch: Fix object/library link order for --as-needed.

When building with --as-needed, libraries need to be listed on the
link line after the objects that reference them.  In the autotools
world (and elsewhere), the LDFLAGS variable has been split into
LDFLAGS and LDADD to represent the need to list libs last.  This
patch makes that change to your Makefile, so this builds correctly
with --as-needed in LDFLAGS.
separate the testing step from the build step

There are circumstances where you just want to repeat the build
without running the tests.  keeping the "test" target distinct from
the "all" target makes it possible to do that cleanly.
Merge pull request #19 from dkg/wolf

build system fixes