Man charged with making terrorist threats at courthouse