Accounting for machines in the labor theory of value
"I have read that the Labour Theory of Value holds that the value of a good or service is determined by the total amount of labour involved in its production."
That would be Adam Smith's version of the LTV, which according to him only holds in pre-capitalist societies. 
Karl Marx's version is thus:
the value of a good or service is determined by the total amount of socially-necessary labor involved in its production.
Socially necessary labor is basically the average amount of labor a society (industry, trading network or whatever) requires to produce a good. 
It takes far less labor time on average to produce randomly mixed chemicals than to produce penicillin from chemical precursors.