Hurricane Pamela hits Mexico, weakens to tropical storm