The command line passes through the project macro expander, where common macros are like $(NAME) - but can also be as simple as $N (a single letter, like in POMAKE). In this case $S is taken as a reference to macro S, which doesn't exist (probably) and is replaced with an empty value. $$ can be used for a literal $.
Not a bug, but the documentation could probably be better...