fix sed -i gnu/bsd compat

by using $(SED) and $(SED_I).  This doesn't strictly feature-detect for
the different behavior of `sed -i`, but it works with both gnu and bsd
sed, so I'm happy for now.