This error is by far the most often reported installation error seen by users. This is caused because qmail does not contain the errno.h file which causes a problem with glibc 2.3.1 and later.
To fix this Erwin Hoffmann suggests a one-line fix. It works for most DJB software:
cat error.h | sed -es/^extern\ int\ errno\;/#include\ \<errno.h\>/ >error.h
Or, DJB suggests that you edit conf-cc to read:
cc -O2 -include /usr/include/errno.h
If these tips dont help you can find the patches to all of DJB's software here:
djbware.csi.hu/patches