diff -Naur Python-2.7-org/setup.py Python-2.7/setup.py
--- Python-2.7-org/setup.py	2010-06-27 14:36:16.000000000 +0200
+++ Python-2.7/setup.py	2010-07-13 22:23:04.000000000 +0200
@@ -1125,7 +1125,7 @@
                                                                'ndbm'):
                             ndbm_libs = ['ndbm']
                         else:
-                            ndbm_libs = []
+                            ndbm_libs = ['gdbm', 'gdbm_compat' ]
                         print "building dbm using ndbm"
                         dbmext = Extension('dbm', ['dbmmodule.c'],
                                            define_macros=[
@@ -1140,7 +1140,7 @@
                         if self.compiler.find_library_file(lib_dirs,
                                                                'gdbm_compat'):
                             gdbm_libs.append('gdbm_compat')
-                        if find_file("gdbm/ndbm.h", inc_dirs, []) is not None:
+                        if find_file("ndbm.h", inc_dirs, []) is not None:
                             print "building dbm using gdbm"
                             dbmext = Extension(
                                 'dbm', ['dbmmodule.c'],
