I 've got an answer on my question on another forum:
I had to run ldconfig -v
It passes this point now, but gets stuck on another file: nmdb.h
gcc -c -I../.. -I/usr/lib/perl5/5.6.1/i586-linux/CORE -I/usr/local/mm-1.1.3 -I../../os/unix -I../../include -DLINUX=22 -I/usr/include/db1 -DMOD_SSL=208108 -DMOD_PERL -DUSE_PERL_SSI -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_HSREGEX -DEAPI -DEAPI_MM -DUSE_EXPAT -I../../lib/expat-lite `../../apaci` mod_rewrite.c
In file included from mod_rewrite.c:93:
mod_rewrite.h:133: ndbm.h: No such file or directory
make: *** [mod_rewrite.o] Error 1
make: *** [all] Error 1
make: *** [subdirs] Error 1
make: Leaving directory `/usr/local/apache_1.3.24/src'
make: *** [build-std] Error 2
make: Leaving directory `/usr/local/apache_1.3.24'
make: *** [build] Error 2
this file is on my system in the directory /usr/include/db1
I tried the same thing (ldconfig -v) but it's magic was gone - it didn't work anymore...
Any idea how to resolve this?