diff --git a/lib/md4.c b/lib/md4.c
index 184985755e39b0278ea2da444ad9c828858ff889..0b4ea9a3c36ccbb46637387fe721cdc061bf8610 100644
--- a/lib/md4.c
+++ b/lib/md4.c
@@ -41,6 +41,9 @@
 #ifdef USE_OPENSSL
 #include <openssl/opensslconf.h>
 #endif
+#ifdef USE_MBEDTLS
+#include <mbedtls/config.h>
+#endif
 
 /* The NSS, OS/400, and when not included, OpenSSL and mbed TLS crypto
  * libraries do not provide the MD4 hash algorithm, so we use this