"Safe working environments" come in my experience from your boss/partner knowing someone in authority who can make it all go away if things get tricky. This is all very good but as with most things in Turkey that rely on who you know, people change, they move on (or are moved on) and your "safe working environment may be no more. And yes, the companies get significant fines too.
In practice the ratio of foreigners working illegally to deportations is actually very low and you are statistically (at this time) unlikely to have a problem. But if you do - and if you are good at what you do you will draw attention I assure you - you may be on the next flight out of Dalaman to the UK. Not where you live necessarily - you may be from Bristol and the next UK flight is the Aberdeen one...
And if you have a property over there, or other significant ties, you may not be able to sort them out before you go - or return to do so for a number of years.
So the answer is...erm...probably no problem but if unlucky, a big problem. Getting a kimlik after 5 years isn't automatic or easy either.
Take a look at positions that give a work permit - the number of work permits issued has increased massively in the last 10 years.