Use 3rdparty headers from the submodule
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6292c52..fb1de81 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -189,7 +189,7 @@
     endif(ZLIB_FOUND)
 endif(ENABLE_ZLIB_SUPPORT)
 
-add_subdirectory(3rdparty)
+add_subdirectory(crypto/3rdparty)
 include_directories(${thirdparty_inc})
 list(APPEND libs ${thirdparty_lib})
 add_definitions(${thirdparty_def})
diff --git a/library/Makefile b/library/Makefile
index 1529093..1764b05 100644
--- a/library/Makefile
+++ b/library/Makefile
@@ -80,9 +80,11 @@
 		ssl_srv.o	ssl_ticket.o		\
 		ssl_tls.o
 
-include ../3rdparty/Makefile.inc
-LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES)
-OBJS_CRYPTO+=$(THIRDPARTY_CRYPTO_OBJECTS)
+INCLUDING_FROM_MBEDTLS:=1
+include ../crypto/3rdparty/Makefile.inc
+LOCAL_CFLAGS += $(patsubst -I../3rdparty/%, -I../crypto/3rdparty/%, $(THIRDPARTY_INCLUDES))
+OBJS_CRYPTO  += $(patsubst ../3rdparty/%, ../crypto/3rdparty/%, $(THIRDPARTY_CRYPTO_OBJECTS))
+
 
 .SILENT:
 
diff --git a/programs/Makefile b/programs/Makefile
index 0e4f7d6..589b1b5 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -18,8 +18,10 @@
 LOCAL_CFLAGS += -I../crypto/include
 LOCAL_CXXFLAGS += -I../crypto/include
 
-include ../3rdparty/Makefile.inc
-LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES)
+INCLUDING_FROM_MBEDTLS:=1
+include ../crypto/3rdparty/Makefile.inc
+LOCAL_CFLAGS += $(patsubst -I../3rdparty/%, -I../crypto/3rdparty/%, $(THIRDPARTY_INCLUDES))
+LOCAL_CFLAGS += $(patsubst -I../3rdparty/%, -I../crypto/3rdparty/%, $(THIRDPARTY_INCLUDES))
 
 ifndef SHARED
 DEP=../crypto/library/libmbedcrypto.a ../library/libmbedx509.a ../library/libmbedtls.a
@@ -104,7 +106,7 @@
 endif
 
 fuzz:
-	$(MAKE) -C fuzz
+	$(MAKE) -C fuzz THIRDPARTY_INCLUDES=$(THIRDPARTY_INCLUDES)
 
 $(DEP):
 	$(MAKE) -C ../library
diff --git a/programs/fuzz/Makefile b/programs/fuzz/Makefile
index f2195d1..83059aa 100644
--- a/programs/fuzz/Makefile
+++ b/programs/fuzz/Makefile
@@ -8,6 +8,7 @@
 LOCAL_LDFLAGS += -L../../crypto/library
 LOCAL_CFLAGS += -I../../crypto/include
 CRYPTO := ../../crypto/library/
+LOCAL_CFLAGS += $(patsubst -I../3rdparty/%, -I../../crypto/3rdparty/%, $(THIRDPARTY_INCLUDES))
 
 ifndef SHARED
 DEP=$(CRYPTO)libmbedcrypto.a ../../library/libmbedx509.a ../../library/libmbedtls.a
diff --git a/tests/Makefile b/tests/Makefile
index 3857778..1c7efe0 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -16,8 +16,9 @@
 LOCAL_CFLAGS += -I../crypto/include
 CRYPTO := ../crypto/library/
 
-include ../3rdparty/Makefile.inc
-LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES)
+INCLUDING_FROM_MBEDTLS:=1
+include ../crypto/3rdparty/Makefile.inc
+LOCAL_CFLAGS += $(patsubst -I../3rdparty/%, -I../crypto/3rdparty/%, $(THIRDPARTY_INCLUDES))
 
 # Enable definition of various functions used throughout the testsuite
 # (gethostname, strdup, fileno...) even when compiling with -std=c99. Harmless