make: Fix syntax errors in 'for' loops

Need to escape the $ in the iter variable: s/$i/$$i/
Need to add forgotten '\' line-continuations.