THRIFT-4717: fix up make clean with autoconf
diff --git a/lib/csharp/Makefile.am b/lib/csharp/Makefile.am
index 56a8b0f..cc2bbc9 100644
--- a/lib/csharp/Makefile.am
+++ b/lib/csharp/Makefile.am
@@ -92,9 +92,12 @@
 Thrift.45.dll: $(THRIFTCODE)
 	$(CSC) $(CSC_DEFINES) -out:$@ -target:library -reference:System.Web $(THRIFTCODE)
 
-clean-local:
-	$(RM) Thrift.dll  \
-	$(RM) Thrift.45.dll
+CLEANFILES = \
+	Thrift.dll \
+	Thrift.45.dll
+
+DISTCLEANFILES = \
+	Makefile.in
 
 EXTRA_DIST = \
 	$(THRIFTCODE) \
@@ -109,7 +112,3 @@
 	test \
 	coding_standards.md \
 	README.md
-
-MAINTAINERCLEANFILES = \
-	Makefile \
-	Makefile.in
diff --git a/lib/csharp/test/Multiplex/Makefile.am b/lib/csharp/test/Multiplex/Makefile.am
index 57253d6..9c1f1b8 100644
--- a/lib/csharp/test/Multiplex/Makefile.am
+++ b/lib/csharp/test/Multiplex/Makefile.am
@@ -41,8 +41,19 @@
 MultiplexServer.exe: Server/Multiplex.Test.Server.cs ThriftImpl.dll
 	$(CSC) $(CSC_DEFINES) -out:$@ -reference:../../Thrift.dll -reference:ThriftImpl.dll $<
 
+CLEANFILES = \
+	MultiplexClient.exe \
+	MultiplexServer.exe \
+	ThriftImpl.dll
+
+DISTCLEANFILES = \
+	Makefile.in
+
 clean-local:
-	$(RM) -rf gen-csharp *.exe *.dll
+	$(RM) -rf gen-csharp
+
+dist-hook:
+	$(RM) -r $(distdir)/gen-csharp/
 
 TESTPORT = 9501
 check-local: MultiplexServer.exe MultiplexClient.exe