diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4c125c4b8a553c29fe7506d88a05a8d0eea58f0a..721cd6dca4d04be6d6153a00043ea5029d653116 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -4,7 +4,7 @@ add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32)
 
 # Core sources
 target_sourcefile(c)
-target_sources(SRB2SDL2 PRIVATE comptime.c md5.c config.h)
+target_sources(SRB2SDL2 PRIVATE comptime.c md5.c config.h.in)
 
 set(SRB2_ASM_SOURCES vid_copy.s)
 
diff --git a/src/Makefile b/src/Makefile
index ce0e849879576d0ca58ea8e080d1a1f8fdfd2f56..9659a4994c1dce6e94981ff090b0b4f1e9a171bf 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -376,7 +376,7 @@ ifdef Echo_name
 	@printf '%-20.20s\r' $$<
 endif
 endif
-	$(.)$(cc) -MM -MF $$@ -MT $(objdir)/$$(*F).o $(2) $$<
+	$(.)$(cc) -MM -MF $$@ -MT $(objdir)/$$*.o $(2) $$<
 endef
 
 $(eval $(call _recipe,c))