I was trying out budgie desktop environment. After I installed it and removed it, I logged back in unity and my nautilus window now has close, maximize and minimize buttons re-appearing as below:
When I removed budgie, I used the purge command but I think there are some settings still remaining which has overridden the nautilus configuration.
I tried fixing it by reinstalling nautilus and nautilus-data packages. I also tried deleting the config present in ~/.config/nautilus.
Nothing has worked till now. Please help !