Lacing up a 40 hole rim will probably NOT work unless the holes are centered on the rim. If the holes alternate to each side, you will need to lace the spokes in pairs (lace two adjacent holes, skip two holes) and if you only have 20 spokes, the void between pairs of spokes will be huge and likely result in a very flexible wheel.
Kevin Ko
Eugene, Oregon USA