build: fix the build with --enable-automatic-dependencies=yes