diff -Naur libotr-4.0.0-orig/src/Makefile.am libotr-4.0.0/src/Makefile.am
--- libotr-4.0.0-orig/src/Makefile.am	2012-08-23 15:39:06.000000000 +0400
+++ libotr-4.0.0/src/Makefile.am	2014-07-09 22:39:18.381600000 +0400
@@ -5,7 +5,7 @@
 libotr_la_SOURCES = privkey.c context.c proto.c b64.c dh.c mem.c message.c \
 		    userstate.c tlv.c auth.c sm.c context_priv.c instag.c
 
-libotr_la_LDFLAGS = -version-info @LIBOTR_LIBTOOL_VERSION@ @LIBS@ @LIBGCRYPT_LIBS@
+libotr_la_LDFLAGS = -no-undefined -version-info @LIBOTR_LIBTOOL_VERSION@ @LIBS@ @LIBGCRYPT_LIBS@
 
 otrincdir = $(includedir)/libotr
 
diff -Naur libotr-4.0.0-orig/toolkit/Makefile.am libotr-4.0.0/toolkit/Makefile.am
--- libotr-4.0.0-orig/toolkit/Makefile.am	2012-05-03 17:52:22.000000000 +0400
+++ libotr-4.0.0/toolkit/Makefile.am	2014-07-09 22:42:43.687000000 +0400
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -I$(includedir) -I../src @LIBGCRYPT_CFLAGS@
+AM_CPPFLAGS = -I$(includedir) -I$(top_srcdir)/src @LIBGCRYPT_CFLAGS@
 
 noinst_HEADERS = aes.h ctrmode.h parse.h sesskeys.h readotr.h sha1hmac.h
 
