You could probably do fine with 36 spokes or even 32. OTOH, how much of a burden will it be to carry an extra 4 or even 8 extra spokes around in the wheel? Unless you're racing I doubt that amount of added weight will ever make a difference in your enjoyment of a trip. If the other wheel components are in decent shape and you're not planning to change to 700c then I'd advise rebuilding the wheel as is with the 40 spokes.