If there is no nonland card to choose, and you have four or more card types among cards in your graveyard, you'll search that player's library even though you won't be able to find any cards. That library will be shuffled.