Foreigners build things in the US all the time. You would have to prove the money was illegally obtained and that would be very hard to do.
If that money is from any group on the State Department's list of terrorism, then the funding of the mosque is against the law. The law is the law. No two ways about it.