US stocks end flat though Amazon deal weighs; dollar dips