Use -ltdb instead of bin/libtdb.so for linking.