It is extremely unlikely the motor itself is damaged. The burned connector is an indication of bad connections AT the connector. This causes heat, which causes the melted plastic. The motor is unlikely to die, other than from over-heating due to an extended period of running at continuous high current. As the connector was almost certainly the cause of the failure, even the driver is, more likely than not, still ok.
Regards,
Ray L.