Ok, did some more researching and googling and found an explanation an workaround at:
Apparently the readline support in PHP (PHP CLI with libedit compiled in for readline support on Ubuntu Lucid) causes the issue in some way (not analyzed by Paul Serby) and the workaround is to explicitly take control of the standard input of the PHP process.
For example:
TARGETS = $(php -r 'echo "target1 target2";' < /dev/null )
or
TARGETS = $(echo '' | php -r 'echo "target1 target2";' )
both solutions work on both platforms I tried.
Further references: