diff --git a/configure.ac b/configure.ac
index 30c89fe66a6dcff308cd29eb595bc41f04203e90..3a93831c2ce1d49d49660e74c0820cd040f5c0f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,6 +4,12 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ([2.69])
 AC_INIT([Jami Daemon],[10.0.0],[jami@gnu.org],[jami])
 
+dnl Clear the implicit flags that default to '-g -O2', otherwise they
+dnl take precedence over the values we set via the
+dnl DAEMONCFLAGS/DAEMONCXXFLAGS variables below.
+: ${CFLAGS=""}
+: ${CXXFLAGS=""}
+
 AC_COPYRIGHT([[Copyright (c) Savoir-faire Linux 2004-2021]])
 AC_REVISION([$Revision$])