There are two issues here:
FIL lost his wife suddenly a mere two years ago. He may be missing physical contact (my step-mum who was NEVER physically demonstrative, quite the opposite, when her partner was alive, suddenly became very touchy feely after he died, so desperate that she sometimes asked for hugs 😞). Or he may have any of the getting older issues that everyone is referring to. Or he may not.
You don't want to be touched, 100% fair enough. It doesn't matter why he's doing it but you don't like it.
Can you, in the context of the way you normally speak to each other, make light of it in a way that is clear that you want him to stop? If he was my FIL I'd be able to say "listen you old bugger, I know you want a hug sometimes, and that's fine, sometimes, but I'm not really a hugger, except with DH and it's making me nervous...so can you try not to do it?" And then give him whatever kind of normal hug/kiss you usually do, and then back off laughing...like that's his lot for the day?
Whatever is going on here, you need to have put boundaries in place, in a way that whatever his motivation, he stops. And if his motivation is entirely innocent - as I'm sure it will be (or at worst a bit misguided, emotionally replacing his wife with you) - then no harm will have been done to anyone's pride or emotional wellbeing. Just a re-set that everyone can cope with. And if his motivation is less benign, then hopefully he'll just be quietly embarrassed and back off...without you having had to name it.
Tricky stuff, I hope you manage to sort it out ok.