The piece you are indicating as melted is a shield and does not have to be there for the alternator to properly operate. If the cause of this problem was a loose connection of the charging lead, the loose connection would ark and cause heating which would melt the plastic shield.

There is an insulator, which is critical, in the alternator housing that the charging stud passes through, if this insulator is un-damaged and you can tighten the nuts, do not over tighten, under and on top of the charging lead the charging system should work properly.

If the insulator around the charging stud is damaged it must be replaced. It may be necessary to remove the alternator and take it to an alternator repair shop, because they may have a generic part to repair your alternator.