You don't have to choose a target artifact or enchantment for the last ability. However, if you do, and that permanent is an illegal target at the time the ability tries to resolve, the ability won't resolve and none of its effects will happen. You won't shuffle Kogla and Yidaro into your library and you won't draw a card.