diff --git a/syntax/makefile.nanorc b/syntax/makefile.nanorc
index 188f004ad66ee8133137b24230cb653463256ab9..71f39f03d949fb09ea6fed8ce57d4891969a95d0 100644
--- a/syntax/makefile.nanorc
+++ b/syntax/makefile.nanorc
@@ -7,7 +7,7 @@ color red "[:=]"
 color magenta "\<(if|ifeq|else|endif)\>"
 color blue "\$+[{(][a-zA-Z0-9_-]+[})]"
 color brightblue "^[^ 	]+:"
-color green "#.*$"
+color green "(^|[[:space:]]+)#.*"
 
 ## Trailing whitespace.
 color ,green "[[:space:]]+$"