I haven't been to the Amalfi Coast recently enough to help on that score. I've never been to Pompeii.
I can tell you that Lecce is a lovely Baroque city very worth exploring. I'd think the weather in Puglia should be pleasant in October. There were walking tours offered during the summer in 2015, and the
tourist office's website indicates they have more of them now. What's happening in October I do not know. Puglia's a popular beach destination in the summer, at least for folks from the UK.
There are many cute small towns in Puglia if you can get to them. Each tends to be worth a couple of hours for wandering around, plus perhaps time for a meal. The tricky part is to get to more than one of them per day if you don't have your own wheels. Many are accessible by bus; probably a few have train service. The problem is linking them together. Rome2Rio.com is a good place to explore transportation options, but you absolutely must ignore the fares, travel times and frequencies shown on that website. Just use it to figure out who runs the buses and trains you need, then click on the links to those companies' websites to look for the schedules. Sometimes it's easier to Google something like
bus Lecce to Gallipoli rather than working through Rome2Rio. Although most trains in Italy are run by Trenitalia, there's at least one other company operating in Puglia. I trust Rome2Rio will provide that information when pertinent.
I spent nearly a week in Lecce in the summer of 2015 and took advantage of van transportation (not really tours) organized by the Lecce tourist office. I don't know that there's enough demand in October for those trips to run; they were on-demand rather than scheduled even in the summer. You can take a look at the currently-posted options
here, if only to see what towns are popular enough to be included. It would be worthwhile to stop in at th tourist office in any case, to get suggestions and tips on things to see in the area.
It would be sort of a shame to miss the trulli (Google for photos) around Alberobello, though the town is admittedly touristy.
I've heard that the city of Bari has an attractive historic district but have never been there.
Matera, in Basilicata but covered by some tours from Lecce (and possibly also Bari), is known for its cave dwellings. It might be possible to see Matera on your way west; there's rail service to Matera from either Rome or Naples, I believe.