Here is a short patch to build libnotmuch.so and link against the notmuch binary against it. I think the notmuch rule in Makefile.local is probably missing a dependency on lib/libnotmuch.so, but I wasn't sure how to specify it without having it be added to the linker command line.
Let me know what you think. Thanks! - Ben