Omit configure checks when unnecessary

If building the library, there is no need to check for hyperleveldb, popt, or
glog.
Unlink the shared objects earlier in the error case
Reorder library link order.

For the static build, the link order matters.  Linking B before A when A links
B's symbols ended up with many errors about symbols that were not found.  Change
the link order so that A->B implies A comes before B on the linker cmd line.