Giving a gift when returning something borrowed
Question

                A friend of mine lent me a sewing machine. I'd like to thank
her for lending me by making something on the machine for her, or buying something for 
her to tell her thanks. IS this considered a branch of Riba?
Praise be to Allah.
      This is counted as a gift in return for the favour that 
      your friend did for you, in appreciation for her kindness. It is not 
      ribaa, rather your doing that is part of the Sunnah. It says in a saheeh 
      hadeeth that Ibn ‘Umar said: “The Messenger of Allaah SAWS (peace and 
      blessings of Allaah be upon him) said: ‘If someone does you a favour then 
      give something in return, and if you cannot find anything then make du’aa’ 
      for him until you feel satisfied that you have done something in return.’” 
      (Narrated by al-Nasaa’i, al-Zakaah, 2520; classed as saheeh by 
      al-Albaani in Saheeh Sunan al-Nasaa’i, no. 2407).

    And Allaah says (interpretation of the meaning):

    “Is there any reward for good other than good?”

    [al-Rahmaan 55:60]

    Al-Bukhaari narrated that Abu Hurayrah (may Allaah be pleased 
    with him) said: “The Prophet SAWS (peace and blessings of Allaah be upon 
    him) owed a camel of a certain age to a man, who came to ask for it back. 
    The Prophet SAWS (peace and blessings of Allaah be upon him) told his 
    companions to give to him. They looked for a camel of the same age but they 
    could find only a camel which was a year older. The Prophet SAWS (peace and 
    blessings of Allaah be upon him) told them to give it to him. The man said, 
    ‘You have paid me in full and may Allaah pay you in full.’ The Prophet SAWS 
    (peace and blessings of Allaah be upon him) said, ‘The best among you is the 
    one who pays his debts in the most handsome manner.’” (al-Istiqraad wa 
    Sadaad al-Dayoon, 2393).
Ibn Hajar said: the point here is that the 
    Prophet SAWS (peace and blessings of Allaah be upon him) gave the owner of 
    the camel more than he was entitled to. This is an example of the good 
    attitude of the Prophet SAWS (peace and blessings of Allaah be upon him) and 
    his great kindness, humility and fairness.  This is utterly different to the 
    idea of lending money with the condition that it be paid back with interest, 
    which is the essence of ribaa. And Allaah is the source of strength.