should I use the past perfect tense for the attributive clause?
Both choices are viable. Because you're beginning the sentence "I told", it brings to mind the topic of reported speech. Since you refer to your friend as "he" instead of "you"... this is indirect speech. With indirect speech, you may use the past perfect tense to clarify the order of events. That's an argument in favor of past perfect.
In terms of the simple past, consider the meaning of "the book he gave me". In the present moment, you are telling the present listener (who is not your friend from the story) about "the book". The simple past is effective here. And it's accurate - the event occurred in the past. You may not be going out of your way to clarify the order of events, but it's still understandable from the context.
In the end, the decision may depend on the situation. If you're telling a long story set in the past, which has already been using past perfect, then to be consistent you could continue using it. If you're making a quick statement of fact in the present moment then it's less necessary.
"that" can be omitted. Especially the second "that".
"I told my friend (that) I liked the book (that) he gave me."