There will still be an undistributed amount in some cases, when the deceased has not nominated anyone.
Generally this undistributed amount shall be shared among the nearest relatives of the deceased i.e. Brother(s)/ Sister(s) in the ratio of 2:1.
If there are no brothers or sisters then Prophet Muhammad SAW suggested by his own ijtihad that it will go to the nearest male relative.
أَلْحِقُوا الْفَرَائِضَ بِأَهْلِهَا فَمَا بَقِيَ فَهُوَ لأَوْلَى رَجُلٍ ذَكَرٍ
Give the shares to those who are entitled to them, and what remains over goes to the nearest male heir (Sahih Muslim 3929).