Middlesbrough moved up to second in the Championship table as they came from behind to beat Charlton 4-1 at The Valley.