diff --git a/Makefile.am b/Makefile.am
index 1a11f0bc179ccdbcfddbda3d1b13063521bdb473..9e4dc5a95281796ac4058428a830c80294a8c482 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,14 +6,9 @@ AUTOMAKE_OPTIONS = foreign no-dependencies
 
 EXTRA_DIST = \
 	CHANGES LEGAL maketgz MITX.txt MPL-1.1.txt \
-	config-win32.h reconf packages/README \
-	packages/Linux/RPM/README \
-	packages/Linux/RPM/curl-ssl.spec.in \
-	packages/Linux/RPM/curl.spec.in \
-	packages/Linux/RPM/make_curl_rpm \
-	packages/Win32/README
+	config-win32.h reconf packages/README
 
-SUBDIRS = docs lib src include tests
+SUBDIRS = docs lib src include tests packages
 
 test:
 	@(cd tests; make quiet-test)
diff --git a/configure.in b/configure.in
index 763f9194487680465572d6509ee7aedb3d37d0fc..f4a0a2a173ce11cba20619b9db0c4d21aeaed16a 100644
--- a/configure.in
+++ b/configure.in
@@ -615,6 +615,10 @@ AC_OUTPUT( Makefile \
 	   src/Makefile \
            lib/Makefile \
            tests/Makefile \
+	   packages/Makefile \
+	   packages/Win32/Makefile \
+	   packages/Linux/Makefile \
+	   packages/Linux/RPM/Makefile \
 	   packages/Linux/RPM/curl.spec \
 	   packages/Linux/RPM/curl-ssl.spec )
 
diff --git a/packages/Linux/Makefile.am b/packages/Linux/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..5753055799b263c6fcba124906fdfe3332459e4d
--- /dev/null
+++ b/packages/Linux/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = RPM
diff --git a/packages/Linux/RPM/Makefile.am b/packages/Linux/RPM/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..5d46d87c67100c702b4706d42fac6ba72498b660
--- /dev/null
+++ b/packages/Linux/RPM/Makefile.am
@@ -0,0 +1,2 @@
+EXTRA_DIST = README curl-ssl.spec.in curl.spec.in make_curl_rpm
+
diff --git a/packages/Makefile.am b/packages/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..21490bd30fbb7ebae8bd222a6ccfc60b034e6327
--- /dev/null
+++ b/packages/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = Win32 Linux
diff --git a/packages/Win32/Makefile.am b/packages/Win32/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..952fde6edc296ea6c3e76475c22b77a668db6047
--- /dev/null
+++ b/packages/Win32/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = README
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 355c6f9a59159c360898edda7dafd36098a327c2..aa37e30399ffd0e25404485c875db3c386abbc70 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,4 +1,4 @@
-EXTRA_DIST = data/*.txt ftpserver.pl httpserver.pl runtests.pl
+EXTRA_DIST = data ftpserver.pl httpserver.pl runtests.pl
 
 all:
 install: