Abraham (PBUH) did not know anyone to teach him, he did not know the name of Allah, he did not know religion at all. but he thought of a creator and he wished to reach God. any human being in this world, even if he did not hear the name of religion would think about where he came from. any human being with or without knowledge of religion have a chance to make a wish to reach God. this is what makes people earn heaven.
how many times did you hear the names like hell and heaven? when this world ends, if you realize that you earn hell would you be able to say 'i did not know about it' or 'i was not warned about it'? God would not send anyone to hell with pleasure. God does not want anyone to earn hell therefor there are holy books that warn people about after life. if we were not warned and informed about after life, then, of course, that would be very cruel. but you see, even though we do not believe in after life, we do not have chance to say we did not know.
.