Use #ifdef rather than patch for target_config.h
diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h
index 00daa11..a17faa1 100644
--- a/include/mbedtls/config.h
+++ b/include/mbedtls/config.h
@@ -2421,6 +2421,10 @@
 
 /* \} name SECTION: Module configuration options */
 
+#if defined(TARGET_LIKE_MBED)
+#include "mbedtls/target_config.h"
+#endif
+
 #include "check_config.h"
 
 #endif /* MBEDTLS_CONFIG_H */
diff --git a/yotta/data/adjust-config.sh b/yotta/data/adjust-config.sh
index 1a2fcb6..1c10733 100755
--- a/yotta/data/adjust-config.sh
+++ b/yotta/data/adjust-config.sh
@@ -68,5 +68,3 @@
 conf unset MBEDTLS_SSL_PROTO_TLS1
 conf unset MBEDTLS_SSL_PROTO_TLS1_1
 conf unset MBEDTLS_SSL_TRUNCATED_HMAC
-
-perl -pi -e 's/#include "check_config.h"/#include "target_config.h"\n$&/' $FILE