That's a pain, hopefully an oil change can sort it. I did that in all the e39s and the e53 I had and it always seemed to help.
The 2002 e39 needed a software update for the gearbox ecu at some stage so that might be worth checking too