On Debian 11 (i386), if I execute export root=sudo, and run the build process as non-root user, it fails during the configure phase with
ERROR: zlib not found
Actually, zlib is installed correctly. The log file gives a hint:
ccache: error: Failed to create directory /run/user/0/ccache-tmp: Permission denied
ERROR: zlib not found
If I run the build process as root, the error does not happen.