Do Megalodons like to chew on ships?
If the answer is no, the answer is "Don't worry about it. They are just like whales. Huge, pretty to look at but completely harmless to ships." The answer is likely to be no if the Megalodon's prey-not-prey filter does not identify a ship as prey.
If the answer is yes, the answer will be a bit more complicated. Just remember, Megalodons ate pretty much everything that moved.
Yes, they do
...then we can expect a mix of passive and active measures to thin the Megalodon "herds" or negate their threat. Assuming that Megalodon attacks are fairly rare, it's still worth it for ships and crews to go fishing, trading or raiding. These forays onto the sea will be the test fleet to show what works and what does not in terms of survivability.
Armor Plating - Despite the unprecedented bite force of the Megalodon, if the ship can make itself hard enough to chew then perhaps the Megalodon will look elsewhere.
"Sharking" Ships - Just as whaling ships go looking for whales to kill and process, so too would a sharking ship.
Lookouts - Active measures such as spearing or poisoning require the crew to know when a Megalodon is in the area.
Make it a delicacy - Humans, for some really odd reason find that anything labelled a "delicacy" is really good eating despite everyone else's opinion that it's completely disgusting. Have some enterprising chef make a dish featuring Megalodon steak. As these things often go, demand for Megalodon flesh will increase thus making it profitable to hunt it. If it's very risky to hunt giant sharks, then the price will be very high (thus ensuring a constant stream of fisherman wanting to make their fortunes).
Yes, Megalodons are the top predator of the sea but they're no match for tool-using monkeys.