Obama says settlement building illegitimate