A teen has been charged after allegedly making online threats to a newly opened mosque that referred to a terror attack in which dozens of Muslims were killed.