Income from bribery is Haraam (strictly prohibited). Haraam money must be
disposed off by giving it in charity to the poor and needy without the
intention of gaining any reward.
From the three avenues explained by you, only the orphanage may be
classified as the appropriate avenue for dispensing such money. It is not
permissible to use Haraam money to build a Mosque or Madrasah. In order to
undo the wrong, we advise you give Sadaqah (charity) to the poor and needy,
at least, equivalent to the expended amount on the Mosque and Madrasah. That
may be done over a period of time. If you adopt the above outlet, it is
hoped you will be forgiven and tremendously rewarded by Allah Ta’ala for the
building of the Mosque and Madrasah.
and Allah Ta’ala Knows Best
Mufti Ebrahim Desai