Hello,
The liaisons and pronunciation of ending letter are very tricky in French (such as in the previous example). I think you should not bother too much with them at the beginning. It is just a matter of getting used to them. With time and practice it will come.
As far as the rules are concerned, they exist, but it would be useless trying to memorize them. I do not know any native speakers who know these rules.
To illustrate this subject, a lot of learners are, for instance very confused and disoriented with the pronunciation of the word “plus” in French. I put out an article with a lot of examples, an audio recording and an explanation in English. I thought you might be interested in it, so here is the link:
http://frenchwithfabrice.over-blog.com/2015/06/prononciation-de-plus-en-francais-1ere-partie.html
I hope that helps. I wish you all the best with your language studies.
Have a nice day.
Best regards,
Fabrice