I think there are two ways to deal with this.
One is to go back to your AME with some offiocial evidence of your name change and ask him to reissue the medical certificate in your new name. This would be best, then the Licence issue will go smoothly.
The other is to send in a copy of your original certificate, together with your name change evidence, with your application. This may delay your licence issue a bit while they check it out.
Either way, it shouldnt be a major problem.
MJ