Preheat the oven to 350°F (175°C).
In a large pot, cook the wild rice according to package instructions.
In a large skillet, heat olive oil over medium heat and sauté the onion until translucent.
Add the minced garlic to the skillet and sauté for about a minute until fragrant.
In a large mixing bowl, combine the cooked wild rice, sautéed onions and garlic, diced butternut squash, chicken, thyme, pepper, and chicken broth.
Pour the mixture into a greased 9x13 inch baking dish.
Cover the dish with aluminum foil and bake for 30 minutes.
Remove the foil, stir in cheese if using, and bake for an additional 15 minutes.
Let the casserole cool for 10 minutes before serving.