--- a/Makefile
+++ b/Makefile
@@ -80,6 +80,11 @@ stringbox.so: stringbox.c
 
 $(SRCS): deal.h
 
+# use build architecture compiler for makecounttable; remove -ltcl from LDFLAGS
+include /usr/share/dpkg/architecture.mk
+makecounttable: makecounttable.c
+	$(DEB_BUILD_GNU_TYPE)-gcc $(CPPFLAGS) $(CFLAGS) $(filter-out -ltcl%, $(LDFLAGS)) $< -o $@
+
 counttable.c: makecounttable
 	./makecounttable > counttable.c
 
