Make Makefile respect user-supplied WAF building options.
Temporarily add links to shared libraries, until build system is fixed.

Also, move com_err out of SHARED_LIBS, it should probably use our
version anyway. To be worked on.