The New York City man has been charged after allegedly setting fire to a residential building last month in a fit of rage over losing his job, prosecutors said