How do I decople a microcontroller with odd number of ground pins?
The intent here is probably to allow a low noise ground region around the crystal oscillator, so run AVSS from pin 3 to 38 and right round any components connected to Xin/Xout in a full loop (aka a guard ring) if you aren't using a full ground plane. And of course it must be joined to DVss somewhere... preferably in just one place to avoid loops, perhaps under the chip to pin 33.

You need a cap from AVCC to AVSS as close to pins 3 and 4 as possible, there is no need for one close to pin 38 but there should be a large (47uf) cap on AVcc to AVss somewhere (ditto for DVcc,DVss)