Hurricane Matthew weakens to Category 1