Based on upstream commit:
https://gitlab.freedesktop.org/gstreamer/common/-/commit/52adcdb

diff --git a/common/glib-gen.mak b/common/glib-gen.mak
index 513c9a6..f96db99 100644
--- a/common/glib-gen.mak
+++ b/common/glib-gen.mak
@@ -5,7 +5,8 @@
 #glib_enum_define=GST_COLOR_BALANCE
 #glib_enum_prefix=gst_color_balance
 
-enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+hash := \#
+enum_headers=$(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\")
 
 # these are all the rules generating the relevant files
 %-marshal.h: %-marshal.list
diff --git a/common/gst-glib-gen.mak b/common/gst-glib-gen.mak
index 773f209..98a2925 100644
--- a/common/gst-glib-gen.mak
+++ b/common/gst-glib-gen.mak
@@ -8,7 +8,8 @@
 #glib_gen_decl_banner=GST_EXPORT
 #glib_gen_decl_include=\#include <gst/foo/foo-prelude.h>
 
-enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+hash := \#
+enum_headers=$(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\")
 
 # these are all the rules generating the relevant files
 $(glib_gen_basename)-marshal.h: $(glib_gen_basename)-marshal.list
diff --git a/gst-libs/gst/app/Makefile.in b/gst-libs/gst/app/Makefile.in
index c53aa95..980d4b9 100644
--- a/gst-libs/gst/app/Makefile.in
+++ b/gst-libs/gst/app/Makefile.in
@@ -613,7 +613,8 @@ glib_gen_decl_include = \#include <gst/app/app-prelude.h>
 glib_enum_headers = gstappsrc.h
 built_sources = app-enumtypes.c
 built_headers = app-enumtypes.h
 BUILT_SOURCES = $(built_sources) $(built_headers)
-enum_headers = $(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+hash := \#
+enum_headers = $(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\")
 libgstapp_@GST_API_VERSION@_la_SOURCES = gstappsrc.c gstappsink.c
 nodist_libgstapp_@GST_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)
 libgstapp_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \
diff --git a/gst-libs/gst/audio/Makefile.in b/gst-libs/gst/audio/Makefile.in
index 3db6495..4f94d40 100644
--- a/gst-libs/gst/audio/Makefile.in
+++ b/gst-libs/gst/audio/Makefile.in
@@ -889,7 +889,8 @@ enum_headers = $(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
 @HAVE_X86_TRUE@libaudio_resampler_sse41_la_LDFLAGS = \
 @HAVE_X86_TRUE@	$(GST_LIB_LDFLAGS) \
 @HAVE_X86_TRUE@	$(GST_ALL_LDFLAGS)
 
-enum_headers = $(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+hash := \#
+enum_headers = $(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\")
 
 # Introspection
 @HAVE_INTROSPECTION_TRUE@BUILT_GIRSOURCES = GstAudio-@GST_API_VERSION@.gir
diff --git a/gst-libs/gst/gl/Makefile.in b/gst-libs/gst/gl/Makefile.in
index b278124..17fdb3f 100644
--- a/gst-libs/gst/gl/Makefile.in
+++ b/gst-libs/gst/gl/Makefile.in
@@ -879,7 +879,8 @@ BUILT_SOURCES = $(built_sources) $(built_headers)
 CLEANFILES = $(BUILT_SOURCES) $(am__append_32)
 nodist_libgstgl_@GST_API_VERSION@include_HEADERS = $(built_headers)
 nodist_libgstgl_@GST_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)
-enum_headers = $(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+hash := \#
+enum_headers = $(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\")
 @HAVE_INTROSPECTION_TRUE@BUILT_GIRSOURCES = GstGL-@GST_API_VERSION@.gir
 @HAVE_INTROSPECTION_TRUE@gir_headers = $(patsubst %,$(srcdir)/%, \
 @HAVE_INTROSPECTION_TRUE@	$(gstgl_gir_headers)) $(patsubst \
diff --git a/gst-libs/gst/pbutils/Makefile.in b/gst-libs/gst/pbutils/Makefile.in
index 8436a3a..bcf54b4 100644
--- a/gst-libs/gst/pbutils/Makefile.in
+++ b/gst-libs/gst/pbutils/Makefile.in
@@ -709,7 +709,8 @@ CLEANFILES = $(BUILT_SOURCES) $(am__append_1)
 
 # DISTCLEANFILES is for files generated by configure
 DISTCLEANFILES = $(built_headers_configure)
-enum_headers = $(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+hash := \#
+enum_headers = $(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\")
 @HAVE_INTROSPECTION_TRUE@BUILT_GIRSOURCES = GstPbutils-@GST_API_VERSION@.gir
 @HAVE_INTROSPECTION_TRUE@gir_headers = $(patsubst %,$(srcdir)/%, \
 @HAVE_INTROSPECTION_TRUE@	$(libgstpbutils_@GST_API_VERSION@include_HEADERS)) \
diff --git a/gst-libs/gst/rtp/Makefile.in b/gst-libs/gst/rtp/Makefile.in
index 23d5835..537b64a 100644
--- a/gst-libs/gst/rtp/Makefile.in
+++ b/gst-libs/gst/rtp/Makefile.in
@@ -670,7 +670,8 @@ glib_enum_headers = $(libgstrtpinclude_HEADERS)
 glib_gen_basename = gstrtp
 glib_gen_decl_banner = GST_RTP_API
 glib_gen_decl_include = \#include <gst/rtp/rtp-prelude.h>
-enum_headers = $(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+hash := \#
+enum_headers = $(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\")
 @HAVE_INTROSPECTION_TRUE@BUILT_GIRSOURCES = GstRtp-@GST_API_VERSION@.gir
 @HAVE_INTROSPECTION_TRUE@gir_headers = $(patsubst %,$(srcdir)/%, \
 @HAVE_INTROSPECTION_TRUE@	$(libgstrtpinclude_HEADERS)) \
diff --git a/gst-libs/gst/rtsp/Makefile.in b/gst-libs/gst/rtsp/Makefile.in
index 6ee079d..b27e95f 100644
--- a/gst-libs/gst/rtsp/Makefile.in
+++ b/gst-libs/gst/rtsp/Makefile.in
@@ -671,7 +671,8 @@ glib_enum_headers = $(libgstrtspinclude_HEADERS)
 glib_gen_basename = gstrtsp
 glib_gen_decl_banner = GST_RTSP_API
 glib_gen_decl_include = \#include <gst/rtsp/rtsp-prelude.h>
-enum_headers = $(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+hash := \#
+enum_headers = $(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\")
 @HAVE_INTROSPECTION_TRUE@BUILT_GIRSOURCES = GstRtsp-@GST_API_VERSION@.gir
 @HAVE_INTROSPECTION_TRUE@gir_headers = $(patsubst %,$(srcdir)/%, \
 @HAVE_INTROSPECTION_TRUE@	$(libgstrtspinclude_HEADERS)) \
diff --git a/gst-libs/gst/tag/Makefile.in b/gst-libs/gst/tag/Makefile.in
index 30104ee..897cddf 100644
--- a/gst-libs/gst/tag/Makefile.in
+++ b/gst-libs/gst/tag/Makefile.in
@@ -675,7 +675,8 @@ glib_enum_headers = tag.h gsttagdemux.h
 built_sources = tag-enumtypes.c
 built_headers = tag-enumtypes.h
 BUILT_SOURCES = $(built_sources) $(built_headers)
-enum_headers = $(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+hash := \#
+enum_headers = $(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\")
 libgsttaginclude_HEADERS = \
 	tag.h tag-prelude.h gsttagdemux.h gsttagmux.h xmpwriter.h
 
diff --git a/gst-libs/gst/video/Makefile.in b/gst-libs/gst/video/Makefile.in
index 772effd..3196961 100644
--- a/gst-libs/gst/video/Makefile.in
+++ b/gst-libs/gst/video/Makefile.in
@@ -824,5 +824,6 @@ libgstvideo_@GST_API_VERSION@_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(ORC_LI
 libgstvideo_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
-enum_headers = $(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+hash := \#
+enum_headers = $(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\")
 @HAVE_INTROSPECTION_TRUE@BUILT_GIRSOURCES = GstVideo-@GST_API_VERSION@.gir
 @HAVE_INTROSPECTION_TRUE@gir_headers = $(patsubst %,$(srcdir)/%, \
 @HAVE_INTROSPECTION_TRUE@	$(libgstvideo_@GST_API_VERSION@include_HEADERS)) \
diff --git a/gst/encoding/Makefile.in b/gst/encoding/Makefile.in
index 57a1c9e..d288474 100644
--- a/gst/encoding/Makefile.in
+++ b/gst/encoding/Makefile.in
@@ -628,7 +628,8 @@ noinst_HEADERS = \
 	gstsmartencoder.h	\
 	gststreamcombinerpad.h
 
-enum_headers = $(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+hash := \#
+enum_headers = $(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\")
 all: all-am
 
 .SUFFIXES:
