Wandmakers can guess, to an extent
While the wand may choose the witch or wizard, this is not purely random. It would seem that there are characteristics that the wandmaker may select in order to make a wand more likely to choose a given wielder.
For example, rigidity:
Wand flexibility or rigidity denotes the degree of adaptability and
willingness to change possessed by the wand-and-owner pair - although,
again, this factor ought not to be considered separately from the wand
wood, core and length, nor of the owner’s life experience and style of
magic, all of which will combine to make the wand in question unique.
Wand Lengths & Flexibility, Pottermore
And size:
However, abnormally short wands usually select those in whose
character something is lacking, rather than because they are
physically undersized (many small witches and wizards are chosen by
longer wands).
Wand Lengths & Flexibility, Pottermore
Further, some wands are more “choosy” than others. Phoenix feather wands are picky:
Phoenix feather wands are always the pickiest when it comes to
potential owners, for the creature from which they are taken is one of
the most independent and detached in the world. These wands are the
hardest to tame and to personalise, and their allegiance is usually
hard won.
Wand Cores, Pottermore
On the other hand, dragon heartstring wands tend to bond easily:
While they can change allegiance if won from their original master,
they always bond strongly with the current owner.
Wand Cores, Pottermore
This suggests that they can bond strongly with their current owner. Put another way, such wands can likely “choose” more than one wizard or witch. Of course, we know that there must be some degree of flexibility: given that every tree and magical creature from which a wand is made is unique, Ollivander could not possibly find the exact right one if there were only one match, nor could witches or wizards ever have good replacement wands made.
Indeed, we see this in the very first book:
Harry tried. And tried. He had no idea what Mr. Ollivander was waiting
for. The pile of tried wands was mounting higher and higher on the
spindly chair, but the more wands Mr. Ollivander pulled from the
shelves, the happier he seemed to become. "Tricky customer, eh? Not to
worry, we’ll find the perfect match here somewhere – I wonder, now - -
yes, why not – unusual combination – holly and phoenix feather, eleven
inches, nice and supple."
Harry Potter and the Sorcerer’s Stone
The implication here seems to be that most customers take far less time to match to a wand than Harry, and thus that there could well be multiple matches (though some less ideal than others, obviously, since Ollivander speaks of a "perfect match").
In addition, Ollivander obviously has some basis for the wands he initially hands Harry. Presumably he knows the characteristics that he initially thinks will make for a wand that is likely to "choose" Harry.
Even without a custom-made wand, it would seem, Ollivander usually can find a wand that will choose a customer without too much trouble. Imagine how much easier it would be if he could construct a wand from the exact right materials, knowing the wielder’s personality and magical style. Certainly, he still might not succeed, since every wand is unique, but he’d probably have a very good chance of success.
All this amounts to saying that a wandmaker may not know for sure whether a custom-made wand will choose a wizard or witch, they still can have a very good idea. Besides, in some cases they may have the luxury of making multiple wands if the first one fails to develop a proper bond. This may well have been the case when Ollivander was forced to be in Voldemort’s employ, for example.
There is also much more to using a wand than mere initial compatibility:
“Oh yes, if you are any wizard at all you will be able to channel your
magic through almost any instrument. The best results, however, must
always come where there is the strongest affinity between wizard and
wand. These connections are complex. These connections are complex. An
initial attraction, and then a mutual quest for experience, the wand
learning from the wizard, the wizard from the wand.”
Harry Potter and the Deathly Hallows
Rowling confirms this. With time, one develops an affinity with one’s wand (presumably regardless of how one initially acquired it):
JKR: So one would expect a certain amount of loyalty from one’s wand. So
even if you were disarmed while carrying it, even if you lost a fight
while carrying it, it has developed an affinity with you that it will
not give up easily
As such, even if a wandmaker could not produce a wand with an affinity for a given wielder, with time they could still develop enough of a connection to the wand to use it without difficulty.